home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / BOOTP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-24  |  2.2 KB  |  81 lines

  1. /*************************************************/
  2. /* Center for Information Technology Integration */
  3. /*           The University of Michigan          */
  4. /*                    Ann Arbor                  */
  5. /*                                               */
  6. /* Dedicated to the public domain.               */
  7. /* Send questions to info@citi.umich.edu         */
  8. /*                                               */
  9. /* BOOTP is documented in RFC 951 and RFC 1048   */
  10. /*************************************************/
  11.  
  12. #ifndef _BOOTP_H
  13. #define _BOOTP_H
  14. #ifndef BOOTREQUEST
  15. #ifndef    _SOCKET_H
  16. #include "socket.h"
  17. #endif
  18.  
  19.  
  20. struct bootp {
  21.     char    op;            /* packet opcode type */
  22.     char    htype;            /* hardware addr type */
  23.     char    hlen;            /* hardware addr length */
  24.     char    hops;            /* gateway hops */
  25.     int32    xid;            /* transaction ID */
  26.     int16    secs;            /* seconds since boot began */
  27.     int16    unused;
  28.     struct in_addr    ciaddr;        /* client IP address */
  29.     struct in_addr    yiaddr;        /* 'your' IP address */
  30.     struct in_addr    siaddr;        /* server IP address */
  31.     struct in_addr    giaddr;        /* gateway IP address */
  32.     char    chaddr[16];        /* client hardware address */
  33.     char    sname[64];        /* server host name */
  34.     char    file[128];        /* boot file name */
  35.     char    vend[64];        /* vendor-specific area */
  36. };
  37.  
  38. /*
  39.  * UDP port numbers, server and client.
  40.  */
  41.  
  42. #define BOOTREQUEST        1
  43. #define BOOTREPLY        2
  44.  
  45. #define BOOTP_PAD        0
  46. #define BOOTP_SUBNET        1
  47. #define BOOTP_GATEWAY        3
  48. #define BOOTP_DNS        6
  49. #define BOOTP_HOSTNAME        12
  50. #define BOOTP_END        0xff
  51.  
  52. #if 0
  53. /*
  54.  * "vendor" data permitted for Stanford boot clients.
  55.  */
  56. struct vend {
  57.         unsigned char  v_magic[4];     /* magic number */
  58.         unsigned long  v_flags;        /* flags/opcodes, etc. */
  59.         unsigned char  v_unused[56];   /* currently unused */
  60. };
  61.  
  62. #define VM_STANFORD     "STAN"  /* v_magic for Stanford */
  63. #endif
  64.  
  65. /* v_flags values */
  66. #define VF_PCBOOT       1       /* an IBMPC or Mac wants environment info */
  67. #define VF_HELP         2       /* help me, I'm not registered */
  68.  
  69. extern int WantBootp;
  70. extern char bp_ascii[];
  71.  
  72. #ifdef __GNUC__
  73. struct ip;            /* forward declaration */
  74. #endif
  75.  
  76. int bootp_validPacket (struct ip *ip,struct mbuf **bpp);
  77.  
  78. #endif
  79.  
  80. #endif
  81.